package com.seleniti.enpareja.controller.ui.widget;

import org.ioc.commons.flowcontrol.actioncontroller.IsExternalAction;
import org.ioc.commons.flowcontrol.eventbus.IsEvent;
import org.ioc.commons.flowcontrol.operationmanager.IsOperation;
import org.ioc.commons.ui.HasEnabled;
import org.ioc.commons.ui.HasLoader;
import org.ioc.commons.ui.HasText;
import org.ioc.commons.ui.HasValue;
import org.ioc.commons.ui.HasVisibility;
import org.ioc.commons.ui.IsDisplay;
import org.ioc.commons.ui.IsPresenter;
import org.ioc.commons.ui.features.Info;

import com.seleniti.enpareja.controller.model.integration.database.domain.Gender;
import com.seleniti.enpareja.controller.model.integration.database.domain.User;

public interface UserForm extends IsDisplay<UserForm.Event, UserForm.Operation, UserForm.Action>, HasEnabled {
	@interface Fires {
		UserForm.Event[] value();
	}

	@interface Invokes {
		UserForm.Action[] value();
	}

	@interface Performs {
		UserForm.Operation[] value();
	}

	public enum Event implements IsEvent {
		UserSaved
	}

	public enum Operation implements IsOperation {
		CheckingEmail, SavingUser, GettingUser, BreakingUp, TryingLogin
	}

	public enum Action implements IsExternalAction {
	}

	public interface Presenter extends IsPresenter {

		void onUserEmailChanged();

		void onCheckEmail();

		void onSave();

		void onEditUser(User user);

		void onPasswordChanged();

		void onPassword2Changed();

		void onEditUser(String userId);

		void onBreakUp();

		void onDownloadApp();

		void onDropSingleMode();

		void onDropTestMode();
	}

	Info userEmailCheckInfo();

	Info passwordCheckInfo();

	HasValue<String> userEmail();

	void checkEmail();

	HasEnabled userEmailEnabled();

	HasText caption();

	HasText saveActionText();

	HasEnabled saveEnabled();

	HasValue<Gender> gender();

	HasValue<String> nickName();

	HasValue<String> password();

	void editUser(User user);

	HasValue<String> password2();

	HasLoader savingIndicator();

	void editUser(String userId);

	HasLoader gettingUserIndicator();

	boolean checkFormValidity();

	Info extraInfo();

	HasVisibility couplePanel();

	HasText coupleName();

	HasLoader breakingUpIndicator();

	HasLoader tryingLoginIndicator();

	void setTryLoginOnSave(boolean tryLoginOnSave);

	boolean isTryLoginOnSave();

	void nickNameFocus();

	HasVisibility downloadApp();

	void setPasswordChangeEnabled(boolean enabled);

	boolean isPasswordChangeEnabled();

	HasVisibility singlePanel();

	HasVisibility testPanel();

	HasLoader droppingSingleModeIndicator();

	HasLoader droppingTestModeIndicator();
}
